<template>
  <div class="list_comment">
    <div class="item_comment" v-for="(o, i) in list" :key="i">
      <div class="left_block">
        <img style="width: 4rem; height: 4rem" :src="$fullUrl(o[vm.avatar])" />
      </div>
      <div class="right_block">
        <div class="top_comment">
          <div class="nickname">{{ o[vm.nickname] }}</div>
        </div>
        <div v-html="o[vm.content]" class="content"></div>
      </div>

      <div class="time">
        {{ o[vm.create_time] }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      default: function () {
        return [];
      },
    },
    vm: {
      type: Object,
      default: function () {
        return {
          avatar: "avatar",
          nickname: "nickname",
          content: "content",
          create_time: "create_time",
        };
      },
    },
  },
  data() {
    return {};
  },
  methods: {},
  components: {},
};
</script>

<style scoped>
.list_comment {
  padding: 0 0.6rem;
}

.item_comment {
  display: flex;
  padding: 0.5rem 0;
}

.item_comment + .item_comment {
  border-top: 1px solid #dbdbdb;
}

.left_block {
  display: inline-block;
  padding: 0.3rem;
  padding-right: 0.5rem;
}

.right_block {
  display: inline-block;
  width: calc(100% - 2.5rem);
}

.time {
  color: #999;
}

.top_comment {
  margin-bottom: 0.6rem;
}

.time {
	width: 200px;
  text-align: right;
  margin-top: 3px;
  font-size: 15px;
  transform: scale(0.8);
}

.top_comment .nickname {
  color: var(--color_grey);
  font-size: 0.8rem;
}

.content {
  font-size: 0.8rem;
}
</style>
